import 'package:flutterdemo/0demo/native/BaseNative.dart';

class TestPlatformViewChannel extends BaseNative {
  TestPlatformViewChannel._() : super("TestPlatformView", eventChannelName: "TestPlatformViewEvent");

  static TestPlatformViewChannel _instance;

  static TestPlatformViewChannel getInstance() {
    if (_instance == null) {
      _instance = TestPlatformViewChannel._();
    }
    return _instance;
  }

  void testNativeMethod() {
    nativeMethod("test");
  }

  onEvent(ChannelEvent channelEvent) {
    _eventCanClick?.call(channelEvent);
  }

  EventCanClick _eventCanClick;

  set eventCanClick(EventCanClick value) {
    _eventCanClick = value;
  }
}

typedef EventCanClick(ChannelEvent channelEvent);
